<template>
    <van-nav-bar title="首页" left-text="返回" left-arrow @click-left="onClickLeft" />
    <van-search v-model="value" shape="round" background="pink" placeholder="请输入搜索关键词" @click="search" />
    <!-- 轮播 -->
    <swiper></swiper>
    <!-- 导航 -->
    <van-grid :column-num="4">
        <van-grid-item v-for="item in navData" :key="value" :icon="item.image_src" :text="item.name" />
    </van-grid>
    <!-- 楼层 -->
    <div v-for="items in floorDate">
        <img style="width: 100%;" :src="items.floor_title.image_src" alt="">
        <div v-for="itemall in items.product_list" style="float: left;">
            <img style="width: 120px;height: 120px;" :src="itemall.image_src" alt="">
        </div>
    </div>
</template>

<script setup>
import swiper from '@/components/swiper.vue'
import {NavApi } from '@/api/api'
import {ref} from 'vue' 
let navData=ref([])
NavApi().then(res=>{
    console.log('宫格数据',res)
    navData.value=res.data.message
})
import {floorApi} from '@/api/api'
let floorDate=ref([])
floorApi().then(res=>{
    console.log('楼层数据',res)
    floorDate.value=res.data.message
})
import {useRouter} from 'vue-router'
let router=new useRouter()
const search=()=>{
    router.push('/search')
}
</script>

<style lang="scss" scoped></style>